import request from '../../utils/request'

export function requestSubmitMsg (title, description, html) {
    return new Promise(resolve => {
        request.post('/message/add', {
            title,
            description,
            html
        }).then(res => {
            resolve(res.data)
        })
    })
}

export function requestMsgList () {
    return new Promise(resolve => {
        request.get('/message/list').then(res => {
            resolve(res.data)
        })
    })
}

export function removeMsg (msgid) {
    return new Promise(resolve => {
        request.post('/message/remove', {
            msgid
        }).then(res => {
            resolve(res.data)
        })
    })
}

export function requestFeedback () {
    return new Promise(resolve => {
        request.get('/message/feedback').then(res => {
            resolve(res.data)
        })
    })
}
